package com.作业.第十章作业.Homework08;

/**
 * 作    者 ：吾路巴尼
 * 创建时间 ：2025/2/15-1:20
 */
public class main {
    public static void main(String[] args) {
        Color[] colors = Color.values();
        for (Color color : colors) {
            switch (color) {
                case RED ->{ System.out.println("红色");
                color.show();
            }
                case BLUE->{
                    System.out.println("蓝色");
                    color.show();
                }
                case GREEN-> {
                    System.out.println("绿色");
                    color.show();
                }
                case YELLOW-> {
                    System.out.println("黄色");
                    color.show();
                }
                case BLACK-> {
                    System.out.println("黑色");
                    color.show();
                }
            }
        }
    }
}
enum Color implements IA{
    RED(255,0,0),BLUE(0,0,255),GREEN(0,255,0)
    ,YELLOW(255,255,0),BLACK(0,0,0);
    private int redValue;
    private int blueValue;
    private int greenValue;

    private Color(int redValue, int blueValue, int greenValue) {
        this.redValue = redValue;
        this.blueValue = blueValue;
        this.greenValue = greenValue;
    }

    @Override
    public void show() {
        System.out.println("redValue="+redValue+",blueValue="+blueValue+",greenValue="+greenValue);
    }
}

interface IA{
    void show();
}